﻿status = -1;
var ItemList1 = Array(
1004422,
1004423,
1004424,
1004425,
1004426,
1102775,
1102794,
1102795,
1102796,
1102797,
1073030,
1073032,
1073033,
1073034,
1073035,
1082636,
1082637,
1082638,
1082639,
1082640,
1152174,
1152176,
1152177,
1152178,
1152179,
1052882,
1052887,
1052888,
1052889,
1052890
);
var ItemList2 =Array(
1004808,
1004809,
1004810,
1004811,
1004812,
1102940,
1102941,
1102942,
1102943,
1102944,
1082695,
1082696,
1082697,
1082698,
1082699,
1053063,
1053064,
1053065,
1053066,
1053067,
1073158,
1073159,
1073160,
1073161,
1073162,
1152196,
1152197,
1152198,
1152199,
1152200
);
var ItemList = Array(
1132246,//超越证明眼饰   贝勒！！
1122267,//超越证明耳环
1032223,//超越证明吊坠
1113075//超越证明戒指

);
function start() {
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == 1) {
        status++;
    } else {
       if (mode == 0 && status == 0) {
			cm.dispose();
			return;
		}
        status--;
    }
    if (status == 0) {
        var avail = "";
			avail+="1、埃苏和神秘做为本服毕业装备之一此功能能够在基础属性上再提升一定的属性\r\n"; 
		        avail+="#r注意：装备必须为白板属性\r\n";
                        avail+="#r注意：把要提升的埃苏装备放在装备栏的第一个位置！\r\n\r\n\r\n#k";
			avail+=" #L0##b我要提升埃苏防具！#l#k\r\n#k";
			avail+=" #L1##b我要提升最高级贝勒德饰品！#l#k\r\n#k";
			avail+=" #L2##b我要提升神秘防具！#l#k\r\n#k";
            cm.sendSimple("#e这里是毕业神装防具属性提升中心:\r\n\r\n#k" + avail);
    } else if(status == 1) {
		var ii = cm.getInventory(1).getItem(1);
		if(selection==0){
			var itemList  = ItemList1;
			var Str = 200;
			var Dex = 200;
			var Luk = 200;
			var Int = 200;
			var all = 200;
		}else if(selection==1){
			var itemList  = ItemList;
			var Str = 200;
			var Dex = 200;
			var Luk = 200;
			var Int = 200;
			var all = 200;
		}else{
			var itemList  = 0;
		}
			if (itemList==0){
				cm.sendOk("出错咯,联系管理员");
				cm.dispose();
				return;
			}
			if(cm.getInventory(1).getItem(1) == null){
				cm.sendOk("请在装备栏第一个位置放上装备！");
				cm.dispose();
				return;
			}
			if (ii.getOwner()=="回忆超强玩家"){
				cm.sendOk("该道具已经提升过了!");
				cm.dispose();
				return;
			}
			var itemid = cm.getInventory(1).getItem(1).getItemId();
			var PD = false;
			for (var i = 0; i < itemList.length; i++) {
                if (itemid==itemList[i]) {
					PD = true;
					break;
                }
            }
			if (PD){
				if(cm.canHold(itemid,1)){
					var STR = cm.getInventory(1).getItem(1).getStr();
					var DEX = ii.getDex();
					var INT = ii.getInt();
					var LUK = ii.getLuk();
					var WATK = ii.getWatk();//物理伤害
					var MATK = ii.getMatk();//魔法伤害
					var ACC = ii.getAcc();
					var JUMP = ii.getJump();
					var SPEED = ii.getSpeed();
					var MDEF = ii.getMdef();
					var WDEF = ii.getWdef();
					var VOID = ii.getAvoid();
					var EN = ii.getEnhance();
					//var UP = ii.getLevel();
					var toDrop = cm.getNewEquip(itemid); // 生成一个Equip类                    
					toDrop.setStr(Str+STR); //装备力量
					toDrop.setDex(Dex+DEX); //装备敏捷
					toDrop.setInt(Int+INT); //装备智力
					toDrop.setLuk(Luk+LUK); //装备运气
					toDrop.setAvoid(VOID);
					toDrop.setWdef(WDEF);
					toDrop.setMdef(MDEF);
					toDrop.setAcc(ACC);
					toDrop.setSpeed(SPEED);
					toDrop.setJump(JUMP);
					toDrop.setWatk(WATK);
					toDrop.setMatk(MATK);
					toDrop.setEnhance(EN);
					toDrop.setUpgradeSlots(0);
					toDrop.setOwner("RMB玩家");
					cm.gainItem(itemid,-1);
					cm.addFromDrop(toDrop);
					cm.worldSpouseMessage(0x0A,""+ cm.getChar().getName() +" ：我从面板提升中心打造 全属性"+all+" "+cm.getItemName(itemid)+"大家一起恭喜我吧!");
					cm.gainItem(Item,-1);
					cm.sendOk("恭喜您，获得了#b#z"+itemid+"#");
					cm.dispose();
			}else{
				cm.sendOk("请检查背包有没有位置");
				cm.dispose();
			}
		}else{
			cm.sendOk("请检查装备栏第一个位置是否为埃苏防具！");
			cm.dispose();
		}
	}
}